import request from '@/utils/request'

// 查询基金名称和基金编码
export function query(params) {
  return request({
    url: '/api/front/fund/codeNameAndNumber',
    method: 'get',
    params: params
  })
}

// 获取基金的基本信息
export function queryFundBaseMessage(codeNumber) {
  return request({
    url: '/api/front/fund/fundBaseMessage',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 股票仓位测算图
export function queryDataFundSharesPositions(codeNumber) {
  return request({
    url: '/api/front/fund/dataFundSharesPositions',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 单位净值走势
export function queryDataNetWorthTrend(codeNumber) {
  return request({
    url: '/api/front/fund/dataNetWorthTrend',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 累计净值走势
export function queryDataACWorthTrend(codeNumber) {
  return request({
    url: '/api/front/fund/dataACWorthTrend',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 累计收益率走势
export function queryDataGrandTotal(codeNumber) {
  return request({
    url: '/api/front/fund/dataGrandTotal',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 同类排名走势
export function queryDataRateInSimilarType(codeNumber) {
  return request({
    url: '/api/front/fund/dataRateInSimilarType',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 同类排名百分比
export function queryDataRateInSimilarPersent(codeNumber) {
  return request({
    url: '/api/front/fund/dataRateInSimilarPersent',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 规模变动 mom-较上期环比
export function queryDataFluctuationScale(codeNumber) {
  return request({
    url: '/api/front/fund/dataFluctuationScale',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 持有人结构
export function queryDataHolderStructure(codeNumber) {
  return request({
    url: '/api/front/fund/dataHolderStructure',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 资产配置
export function queryDataAssetAllocation(codeNumber) {
  return request({
    url: '/api/front/fund/dataAssetAllocation',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 业绩评价
export function queryDataPerformanceEvaluation(codeNumber) {
  return request({
    url: '/api/front/fund/dataPerformanceEvaluation',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 现任基金经理
export function queryDataCurrentFundManager(codeNumber) {
  return request({
    url: '/api/front/fund/dataCurrentFundManager',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 现任基金经理
export function queryDataBuySedemption(codeNumber) {
  return request({
    url: '/api/front/fund/dataBuySedemption',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 获取基金实时估值
export function queryFundInInTimeGuZhi(codeNumber) {
  return request({
    url: '/api/front/fund/guZhi',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 获取基金的涨跌幅图片
export function queryCodeInTimeAndRemoveWatermarkImage(codeNumber) {
  return request({
    url: '/api/front/fund/image',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 获取基金的涨跌幅图片
export function queryCodeInTimeAndRemoveWatermarkImageAll(codeNumber) {
  return request({
    url: '/api/front/fund/imageAll',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 获取基金的头像
export function queryCodeManagerAvatar(codeNumber) {
  return request({
    url: '/api/front/fund/avatar',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 获取基金的头像
export function queryCodeManagerAvatarAll(codeNumber) {
  return request({
    url: '/api/front/fund/avatarAll',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 查询基金股票持仓
export function queryHoldShare(codeNumber) {
  return request({
    url: '/api/front/fund/holdShare',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 查询基金债券持仓
export function queryHoldBond(codeNumber) {
  return request({
    url: '/api/front/fund/holdBond',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 查询单位净值和累计净值走势
export function queryDataACAndNetWorth(codeNumber) {
  return request({
    url: '/api/front/fund/dataACAndNetWorth',
    method: 'get',
    params: { codeNumber: codeNumber }
  })
}

// 查询所有的基金编码名称
export function queryAllCode() {
  return request({
    url: '/api/front/fund/allCode',
    method: 'get'
  })
}

// 新增热搜
export function addHotSearch(hotCode) {
  return request({
    url: '/api/front/fund/addHotSearch',
    method: 'get',
    params: hotCode
  })
}

// 查询所有的基金编码名称
export function hotSearch() {
  return request({
    url: '/api/front/fund/hotSearch',
    method: 'get'
  })
}

export default { query, queryFundBaseMessage, queryDataFundSharesPositions, queryFundInInTimeGuZhi, queryDataNetWorthTrend, queryCodeInTimeAndRemoveWatermarkImage }
